<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue"></script>
  <style>
    @keyframes rotateAnimate {
      0% {
        transform: rotate(0deg);
      }

      25% {
        transform: rotate(90deg);
      }

      50% {
        transform: rotate(180deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }

    .rotateClass {
      animation: rotateAnimate 3s;
    }
  </style>
</head>

<body>
  <div id="root"></div>
  <script>
    /* 
      1. 过渡 vs 动画
      - 过渡：元素的性态的从一个状态到另一个状态
      - 动画：元素复杂变化、运动的过程
      2. css动画案例
      - @keyframes + animation
    */
    const app = Vue.createApp({
      template: `
      <div :class="animate ? 'rotateClass': ''">Hello World</div>
      <button @click="animate = !animate">动画</button>
    `,
      data() {
        return {
          animate: false
        }
      }
    })
    const vm = app.mount('#root');

  </script>
</body>

</html>